<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<%@ page import="com.fengke.portal.config.HostConfig" %>
<%
	HostConfig hostConfig = (HostConfig) request.getSession().getServletContext().getAttribute("hostConfig");
%>
<!DOCTYPE html>
<html>
<head>
<title>生成订单</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1, maximum-scale=1, user-scalable=no">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="resources/travel/weixin/js/jquery.min.js"></script>
<link href="resources/travel/weixin/css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="resources/travel/weixin/css/bootstrap-theme.css" rel="stylesheet" media="screen">
<link href="resources/travel/weixin/css/font-awesome.min.css" rel="stylesheet" media="screen">
<link href="resources/travel/weixin/css/messenger.css" rel="stylesheet" media="screen">
<link href="resources/travel/weixin/css/image.css" rel="stylesheet" media="screen">
<link href="resources/travel/weixin/css/travel.css" rel="stylesheet" media="screen">
<link href="resources/travel/weixin/jslib/jquery-validation-engine/css/validationEngine.jquery.css" rel="stylesheet" media="screen">
<link href="resources/travel/weixin/jslib/icheck/skins/flat/blue.css" rel="stylesheet" media="screen">

<script src="resources/travel/weixin/js/bootstrap.min.js"></script>
<script src="resources/travel/weixin/js/bootbox.js"></script>
<script src="resources/travel/weixin/js/messenger.js"></script>
<script src="resources/travel/weixin/js/messenger-theme-future.js"></script>
<script src="resources/travel/weixin/js/holder.js"></script>

<script src="resources/travel/weixin/jslib/icheck/js/jquery.icheck.min.js"></script>
<script src="resources/travel/weixin/jslib/jquery-validation-engine/js/languages/jquery.validationEngine-zh_CN.js"></script>
<script src="resources/travel/weixin/jslib/jquery-validation-engine/js/jquery.validationEngine.js"></script>
<script src="resources/travel/weixin/js/application.js"></script>
<script type="text/javascript" src="resources/shop/js/common.js"></script>

<style>
a:hover {
	text-decoration:none;
}
a:link {
	text-decoration:none;
}
</style>
<style type="text/css" id="holderjs-style"></style>
</head>
<body >
<div class="container overflow-x" id="orderItem" >
  <div class="row">
    <div class="col-xs-12 col-sm-12 padding_0 order_list animated fadeInDown  margin-top0">
      <div class="panel-group acc-v1 margin-bottom-0 " id="accordion-1">
        <div class="panel panel-default  margin-bottom-20" style="overflow:visible">
          <div class="panel-heading">
            <h4 class="panel-title clearfix"> <a class="accordion-toggle clearfix "><span class="glyphicon glyphicon_peoples glyphicon_size pull-left" ></span><span class="pull-left itineraryfonts">添加[#if isAdult]成人[#else]儿童[/#if]<i class="color_orange" id="memberNum"> 还有${count}人未添加</i></span> </a> </h4>
          </div>
          <div  class="panel-collapse collapse in">
            <div class="panel-body">
              <div class="row">
                <div class="col-xs-12 itinerary_show">
                  <form role="addMemberForm" class="form-horizontal" action="${base}/travel/weixin/order/addMember.jhtml" method="get">
                    <input type="hidden" name=id value="${order.id}">
                     <input type="hidden" name=productId value="${product.id}">
                     
                    <div class="form-group user_news">
                      <label class="col-sm-2 control-label col-xs-2 padding_right0" for="inputEmail3" style="padding-top:7px">姓名</label>
                      <div class="col-sm-4 col-xs-10">
                        <input type="text" placeholder="请输入姓名" name="orderItems[0].memberName" class="validate[required] form-control" maxlength="20" data-prompt-position="topLeft:10">
                      </div>
                    </div>
                    
                    <div class="form-group user_news margin-bottom-30">
	                    <label class="col-sm-2 control-label col-xs-2 padding_right0" for="inputPassword3" style="padding-top:7px">性别</label>
                    	<label class="radio-inline" style="width:30%;text-align:left">
						    <input type="radio" name="orderItems[0].gender" value="male" checked id="radio_gender_1">男
						</label>
		        	    <label class="radio-inline" style="width:30%;text-align:left">
					         <input type="radio" name="orderItems[0].gender" value="female" id="radio_gender_2">女
					    </label>
                    </div>
                   	<input type="hidden" name="orderItems[0].isAdult" value="[#if isAdult]true[#else]false[/#if]">
                  </form>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  
  <div class="row" style="margin-top:1px">
    <div class="col-xs-12 col-sm-12  order_bottombtn padding_10">
      [#if order??&&order.orderItems??&&(order.orderItems.size()< (order.totalNum-1))]
      <button class="btn submit_orders margin-bottom-10" type="button" id="saveAndContinue">保存并继续添加</button>
      [#else]
      <button class="btn submit_orders addnews_safe" type="button" id=save  [#if order??&&order.orderItems??&&(order.orderItems.size()=(order.totalNum-1))]style="margin-top:-5px" [/#if]>保存</button>
      [/#if]
    </div>
  </div>
</div>
</body>
<script>
	var $save=$("#save");
	var $saveAndContinue=$("#saveAndContinue");
	var $orderMain=$("#orderMain");
	var $orderItem=$("#orderItem");
	var orderItemIndex=0;
	var totalMember;
	
	$(function(){
		 $('input:radio').iCheck({
				checkboxClass : 'icheckbox_flat-blue',
				radioClass : 'iradio_flat-blue',
				increaseArea : '100%'
		});
	 	app.validateEngine('form:first');
	});
	
	$saveAndContinue.click(function(){
		var result = $('form').validationEngine('validate');
       	if(!result){
       		return false;
       	} 
		$(this).attr("disabled","disabled");
		$("form").submit();
	})
	
	$save.click(function(){
		var result = $('form').validationEngine('validate');
       	if(!result){
       		return false;
       	} 
		$(this).attr("disabled","disabled");
		$("form").submit();
	})
</script>
</html>